package com.zzty.txj.dao;

import com.zzty.txj.entity.Ability;
import com.zzty.txj.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface AbilityMapper {

    @Update("update ability set performAbility=#{performAbility},credibility=#{credibility} where userId=#{userId}")
    Integer updateAbility(Ability ability);

    @Select("select * from ability")
    List<Ability> getAbility();

    @Insert("insert into ability(userId) values(#{id})")
    Integer addAbility(User user);

    @Select("select * from ability where userId=#{userId}")
    Ability getAbilityByUserId(Integer userId);
}
